#include "plist.h"
#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[]){
    int a,b,c,d,e;
    int *x,*y;
        plist_t path = NULL;
        int *nd = NULL;

    a= 0;
    b=1;
    c=2;
    d=3;
    e=4;
    path = plist_create();
    plist_append(path,&a);
    plist_append(path,&b);
    plist_append(path,&c);
    plist_append(path,&d);
    plist_append(path,&e);
    plist_rewind(path);
    nd = plist_get_next(path);
    while (nd!=NULL){
        printf("el nodo es: %d\n",*nd);
        nd = plist_get_next(path);
    }
    x = plist_get_last(path);
    y = plist_get_prevlast(path);
    plist_rewind(path);

    x = plist_remove_last(path);
    printf("el ultimo es: %d\n",*x);
    x = plist_remove_last(path);
    printf("el ultimo es: %d\n",*x);
    x = plist_remove_last(path);
    printf("el ultimo es: %d\n",*x);
    x = plist_remove_last(path);
    printf("el ultimo es: %d\n",*x);
        x = plist_remove_last(path);
    printf("el ultimo es: %d\n",*x);


    

    
    return 0;
}

